package com.zc.backend.entity;

import lombok.Data;


public class Page {
//    当前页
    private Integer pager;
//    总条数
    private Integer total;
//    每页显示条数
    private Integer pageSize;
//    总页数
    private Integer totalPage;

    public Integer getPager() {
        return pager;
    }

    public void setPager(Integer pager) {
        this.pager = pager;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(Integer totalPage) {
        this.totalPage = pager%pageSize==0 ? pager/pageSize:pager/pageSize+1 ;

    }

    @Override
    public String toString() {
        return "Page{" +
                "pager=" + pager +
                ", total=" + total +
                ", pageSize=" + pageSize +
                ", totalPage=" + totalPage +
                '}';
    }
}
